package com.examples.traversal;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.events.TraverseListener;

public class CustomTraversalListener implements TraverseListener {

	@Override
	public void keyTraversed(TraverseEvent e) {
		switch (e.detail) {
		case SWT.TRAVERSE_ESCAPE:
			System.out.println("Escape Pressed");
			break;
		case SWT.TRAVERSE_ARROW_NEXT:
			System.out.println("Next Arrow Pressed");
			break;
		case SWT.TRAVERSE_ARROW_PREVIOUS:
			System.out.println("Previous Arrow Pressed");
			break;
		case SWT.TRAVERSE_MNEMONIC:
			System.out.println(e.character+" Key Pressed");
			break;
		case SWT.TRAVERSE_RETURN:
			System.out.println("Enter Key Pressed");
			break;
		default:
			break;
		}

	}

}
